<template>
  <div class="block">
    <el-timeline>
      <el-timeline-item v-for="item in workOrderList" :timestamp="item.operationTime,'{y}-{m}-{d}'|parseTime" placement="top">
        <el-card>
          <h4>{{item.operationContent}}</h4>
          <p>{{item.operationPersonName}} 提交于 {{item.operationTime}}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
  import { listWorkOrderLog } from "@/api/workorder/workOrderLog";

  export default {
    /*工单轨迹*/
    name: "workOrderTrack",
    data(){
      return {
        workOrderList:[]
      }
    },
    watch:{
      workOrderId(){
        this.getWorkOrderList()
      }
    },
    created(){
      this.getWorkOrderList()
    },
    methods:{
      getWorkOrderList(){
        listWorkOrderLog({workOrderId:this.workOrderId}).then(res=>{
          this.workOrderList = res.rows
        })
      }
    },
    props: {
      workOrderId: {
        type: String,
        default: "",
      }
    }
  }
</script>

<style scoped>

</style>
